package com.javaxiaobang.counter.util;

import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 功    能：工具类
 * 作    者：java潇邦
 * 时    间：2018-06-01 17:52
 */
public final class LogCounterUtil extends StringUtils {

    private static final Logger logger = LoggerFactory.getLogger(LogCounterUtil.class);

    /**
     * 获取域名
     */
    public static String getDomain() {
        String domain = "";
        try {
            domain = trim(System.getProperties().getProperty("app.instance.name"));
        } catch (Exception e) {
            logger.warn("getDomain:", e);
        }
        return domain;
    }

    /**
     * trim
     */
    public static String trim(String str) {
        return null == str ? "" : str.trim();
    }

}
